<template>
    <div class="member-home">
        <!-- 概览 -->
        <HomeOverview/>
        <!-- 收藏 -->
        <HomePanel title="我的收藏">
            <GoodsItem v-for="item in collectGoods" :key="item.id" :goods="item"/>
        </HomePanel>
        <!-- 足迹 -->
        <HomePanel title="我的足迹">
            <GoodsItem v-for="item in collectGoods" :key="item.id" :goods="item"/>
        </HomePanel>
        <!-- 猜你 -->
        <GoodsRelevant/>
    </div>
</template>

<script>
    import HomeOverview from "@/views/member/home/components/home-overview";

    import GoodsRelevant from "@/views/goods/components/goods-relevant";
    import GoodsItem from "@/views/category/components/goods-item";
    import {findCollect} from "@/api/member";
    import HomePanel from "@/views/member/home/components/home-panel";

    export default {
        name: "index",
        components: {HomePanel, GoodsItem, GoodsRelevant, HomeOverview},
        data() {
            return {
                collectGoods: []
            }
        },
        created() {
            this.findCollect()
        },
        methods: {
            async findCollect() {
                const {result} = await findCollect({page: 1, pageSize: 4})
                this.collectGoods = result.items
            }
        }
    }
</script>

<style scoped>

</style>
